/**
 * 对cookie操作
 * Wayne Wan@ WayneWan.com
 */
CoookieUtils = {};
CoookieUtils.set = function(key, value) {
	document.cookie = key + "=" + value
			+ ";expires = Fri, 31 Dec 2999 23:59:59 GMT";
}

CoookieUtils.get = function(key) {
	var cookies = document.cookie;
	if ((!cookies) || cookies.length < 1)
		return null;
	var pairs = cookies.split(";");
	var cookie;
	for (var i = 0; i < pairs.length; i++) {
		cookie = pairs[i].split("=");
		if (cookie && cookie[0] == key)
			return cookie[1];
	}
	return null;
}

CoookieUtils.clear = function(key) {
	document.cookie = key + "=null;expires=Fri, 31 Dec 1999 23:59:59 GMT";
}
